package defaultPackage;
import java.awt.Graphics;
import java.awt.image.BufferedImage;



public class Camera 
{
	int x = 0,y = 0,xSize,ySize;
	
	BufferedImage image;
	Graphics g;
	public Camera(int xsize,int ysize)
	{
		xSize = xsize;
		ySize = ysize;
		image = new BufferedImage(xsize,ysize,BufferedImage.TYPE_INT_ARGB);
		g = image.getGraphics();
	}
	public void draw(Graphics gfx)
	{
		gfx.drawImage(image, -x, -y,xSize, ySize, null);
	}
	
	public void cameraUp()
	{
		if (y >= 10)
			y -= 10;
	}
	public void cameraDown()
	{
		if (y <= ySize- (MainClass.windowYSize + 10 -100))
			y += 10;
	}
	public void cameraLeft()
	{
		if (x >= 10)
			x -= 10;
	}
	public void cameraRight()
	{
		if (x <= xSize - (MainClass.windowXSize - 190))
			x += 10;
	}
	public int getX()
	{
		return x;
	}
	public int getY()
	{
		return y;
	}
}
